<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <base href="<%= basePath%>"/>
    <title>市场活动统计</title>
    <script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
    <script type="text/javascript" src="jquery/echars/echarts.min.js"></script>
    <script type="text/javascript">
        $(function (){
            $.ajax({
                url:"workbench/chart/activity/getActivityCountByOwner.do",
                type:"post",
                dataType:"json",
                success:function (jsonArray){
                    var myChart = echarts.init(document.getElementById('chartArea'));
                    var option = {
                        title: {
                            text: '市场活动统计'
                        },
                        tooltip: {
                            trigger: 'item',
                            formatter: '{a} <br/>{b} : {c}条'
                        },
                        toolbox: {
                            feature: {
                                dataView: { readOnly: false },
                                restore: {},
                                saveAsImage: {}
                            }
                        },
                        legend: {

                        },
                        series: [
                            {
                                name: '所有人',
                                type: 'funnel',
                                left: '15%',
                                width: '60%',
                                label: {
                                    formatter: '{b}'
                                },
                                labelLine: {
                                    show: false
                                },
                                itemStyle: {
                                    opacity: 0.7
                                },
                                emphasis: {
                                    label: {
                                        position: 'inside',
                                        formatter: '{b}: {c}条'
                                    }
                                },
                                data: jsonArray
                            }
                        ]
                    };
                    myChart.setOption(option);
                }
            })
        })
    </script>
</head>
<body>
<div id="chartArea" style="width: 900px;height:500px"></div>
</body>
</html>
